package com.huiminpay.transaction.api;

import com.huiminpay.common.cache.domain.BusinessException;
import com.huiminpay.transaction.api.dto.PayChannelDTO;
import com.huiminpay.transaction.api.dto.PayChannelParamDTO;
import com.huiminpay.transaction.api.dto.PlatformChannelDTO;

import java.util.List;

public interface PayChannelService {


    /**
     * 查询服务类型
     * @return  服务类型列表
     * @throws BusinessException
     */
    List<PlatformChannelDTO> queryPlatformChannel() throws BusinessException;

    /**
     * 给应用绑定服务类型
     * @param appId  应用Id
     * @param plarformChannelCode  服务类型code
     * @throws BusinessException
     */
    void bindPlatformChannelForApp(String appId,String plarformChannelCode) throws BusinessException;

    /**
     * 查询应用和服务类型鹅绑定状态
     * @param appId  应用Id
     * @param plarformChannelCode  服务类型code
     * @return 1:已绑定  2:未绑定
     * @throws BusinessException
     */
    int queryAppBindPlatformChannel(String appId,String plarformChannelCode) throws BusinessException;

    /**
     * 根据服务类型,查询支付渠道
     * @param plarformChannelCode  服务类型code
     * @return  支付渠道列表
     * @throws BusinessException
     */
    List<PayChannelDTO> queryPayChannelByPlatformChannel(String plarformChannelCode) throws BusinessException;

    /**
     * 保存支付渠道参数
     * @param paramDTO  商户Id  应用Id  服务类型  支付渠道code
     * @throws BusinessException
     */
    void savePayChannelParam(PayChannelParamDTO paramDTO) throws BusinessException;

    /**
     * 根据应用和服务类型查询支付参数
     * @param appId  应用Id
     * @param platformChannelCode  服务类型Code
     * @return  支付参数列表
     * @throws BusinessException
     */
    List<PayChannelParamDTO > queryPayChannelParamByAppAndPlatform(String  appId,String platformChannelCode)throws BusinessException;

    /**
     * 根据应用,服务类型,支付渠道查询支付参数
     * @param appId  应用Id
     * @param platformChannelCode  服务类型Code
     * @param payChannelCode    支付渠道Code
     * @return   该支付渠道的支付参数
     * @throws BusinessException
     */
    PayChannelParamDTO queryParamByAppPlatformAndPayChannel(String  appId,String platformChannelCode,String payChannelCode)throws BusinessException;
}
